package com.imodia.checkoo.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.hsq.commons.util.db.GenericIbatisDao;
import com.hsq.commons.util.db.SqlParam;
import com.hsq.commons.util.db.annotation.SqlSpace;
import com.imodia.checkoo.bean.CmsMenuUserBean;
import com.imodia.checkoo.service.CmsMenuUserService;

@SqlSpace(spaceName = "cmsmenuuser")
@Service
public class CmsMenuUserServiceImpl extends
		GenericIbatisDao<CmsMenuUserBean, Integer> implements
		CmsMenuUserService {

	public void save(List<CmsMenuUserBean> list, int id, int type) {
		SqlParam sql = new SqlParam();
		sql.andEqualTo("department_id", String.valueOf(id));
		sql.andEqualTo("type_id", String.valueOf(type));
		delete(sql);
		batchInsert(list);
	}
}